<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>innerText与innerHTML方法</title>
</head>
<body>
<div class="text"></div>
<div class="html"></div>
<script>
    // innerText
    const text = document.querySelector(".text")
    text.innerText = "innerText添加文本内容，不解析标签"
    // innerHTML
    const html = document.querySelector(".html")
    html.innerHTML = "<strong>innerHTML添加文本，解析标签</strong>"
</script>
</body>
</html>